/*
 * @Author: Dagon
 * @Date: 2021-03-02 15:07:43
 * @Description: js实现继承的方法
 */

 // 1）class+extends 继承（ES6）
class Animal {
  constructor(name) {
    this.name = name
  }
}

class Cat extends Animal {
  constructor(name) {
    super(name)
  }
  eat() {
    console.log(`${this.name} eating`)
  }
}
const cat1 = new Cat('xiaohua')
cat1.eat()
// 2) 
